package com.devicestatus.dao;

import com.devicestatus.entity.Product;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * @author MeowParse
 * @date 2017/8/15.
 */
public interface ProductDao extends JpaRepository<Product,String>{

	@Query(value = "select id,secret_key from product",nativeQuery = true)
	List<Product> getProductIds();

	@Query(value = "select secret_key from product where id = ?",nativeQuery = true)
	String getProductSecret(String productKey);
}
